ISRO CSE 2020
Q2.
An array of 2 two byte integers is stored in big endian machine in byte addresses as shown below. What will be its storage pattern in little endian machine ? \begin{array}{c|c}\text{Address}& \text{Data}\\\hline0 \times 104&78\\0 \times 103&56\\0 \times 102&34\\0 \times 101&12\end{array}Q3.
The immediate addressing mode can be used for1. Loading internal registers with initial values 2. Perform arithmetic or logical operation on data contained in instructionsWhich of the following is true?Q4.
Following declaration of an array of struct, assumes size of byte, short, int and long are 1,2,3 and 4 respectively. Alignment rule stipulates that n byte field must be located at an address divisible by n, the fields in the struct are not rearranged, padding is used to ensure alignment. All elements of array should be of same size. Struct complx Short s Byte b Long l Int i End Complx Complx C[10]Assuming C is located at an address divisble by 8, what is the total size of C, in bytes?Q5.
What is output of the following 'C' code assuming it runs on a byte addressed little endian machine? #include < stdio.h > int main() { int x; char *ptr; x=622,100,101; printf("%d",(*(char *)&x)*(x%3)); return 0; }Q6.
What is the output of the code given below? #include < stdio.h > int main() { char name[]="satellites"; int len; int size; len= strlen(name); size = sizeof(name); printf("%d",len*size); return 0; }Q7.
Consider a 2-dimensional array x with 10 rows and 4 columns, with each element storing a value equivalent to the product of row number and column number. The array is stored in row-major format. If the first element x[0][0] occupies the memory location with address 1000 and each element occupies only one memory location, which all locations (in decimal) will be holding a value of 10?Q8.
If an array A contains the items 10, 4, 7, 23, 67, 12 and 5 in that order, what will be the resultant array A after third pass of insertion sort?